<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const email = '419593547@qq.com'
        console.log((/^\w+@\w+\.\w+$/).test(email))//w是数值或数字或下划线

        const xy = 'hsdhsa@'
        console.log(xy.match(/\W/))//@ W是除数值、数字、下划线之外的


        // 检测5-10位用户名，以字母开头 后面是字母或者数字或者下划线的正则
        const userName = 'dkfjskfi'
        console.log((/^[a-z]\w{4,9}$/).test(userName));
    </script>
</body>
</html>